package ac.github.os.internal.core.script.impl

import ac.github.os.internal.core.script.BaseWrapper
import ac.github.os.internal.core.script.InternalConfig
import ac.github.os.internal.core.script.InternalScript
import ac.github.os.internal.core.trigger.PlayerTrigger
import ac.github.os.internal.core.trigger.Trigger
import me.clip.placeholderapi.PlaceholderAPI
import taboolib.common.platform.Awake

@Awake
class PlaceholderScript : InternalScript<PlaceholderScript.Wrapper> {

    class Wrapper : BaseWrapper

    override val name: String
        get() = "papi"

    override fun execute(trigger: Trigger?, wrapper: Wrapper, config: InternalConfig, string: String): String? {
        return if (trigger is PlayerTrigger) {
            return PlaceholderAPI.setPlaceholders(trigger.player, string)
        } else "entity type not player"
    }

}